package mwm.server.moveresize;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;

import javax.swing.JPanel;
import javax.swing.border.Border;

@SuppressWarnings("serial")
public class OvalBorderPanel extends JPanel {
	
	public OvalBorderPanel() {
		super(new BorderLayout());
		setOpaque(false);
		setBorder(new OvalBorder());
	}
	
	private static class OvalBorder implements Border {
		public OvalBorder() {
		}

		public Insets getBorderInsets(Component c) {
			return new Insets(2, 2, 2, 2);
		}

		public boolean isBorderOpaque() {
			return true;
		}

		public void paintBorder(Component c, Graphics g, int x, int y, int w,
				int h) {
			w--;
			h--;
			g.setColor(Color.white);
			g.fillRoundRect(x, y, w, h, 8, 8);
		}
	}
}